// Copyright 2007 the original author or authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package lichen.services.post;

import lichen.entities.post.Comment;
import lichen.entities.post.Post;
import lichen.entities.post.Topic;

import org.springframework.transaction.annotation.Transactional;

@Transactional
public interface PostService {

	/**
	 * 保存一个Thread.
	 *
	 * @param topic 论坛贴子的主题.
	 */
	@Transactional
	public abstract void saveTopic(Topic topic);

	/**
	 * 保存一个回复.
	 * @param topic  论坛主题对象
	 * @param parentPost 父节点对象
	 * @param comment 一个回复的内容对象.
	 */
	@Transactional
	public abstract void saveComment(Topic topic, Post parentPost,
			Comment comment);

	/**
	 * 把主题帖子的viewNum增加1.
	 * @param topic 主题贴
	 */
	public abstract void increamViewNum(Topic topic);

}